
#ifndef _UnregisteredCommandIn_H_
#define _UnregisteredCommandIn_H_

#include "command.h"

#pragma pack(1)

namespace Cmd
{
        namespace Unregistered
        {
                enum {
                        CMDIN_LOGIN             = 0x0010,
                        CMDIN_LOGINVERIFY       = 0x0011,
                        CMDIN_SESSION           = 0x0012,
                };

                // CMDIN_LOGIN
                enum {
                        SCMDIN_LOGIN                            = 0x0001,       // 请求登录UnregisteredServer
                        SCMDIN_LOGIN_RESPONCE                   = 0x0002,       // 登录UnregisteredServer返回
                };
                // CMDIN_LOGINVERIFY
                enum {
                        SCMDIN_LOGINVERIFY_USER_LOGIN_REQ       = 0x0001,       // 用户请求登录
                        SCMDIN_LOGINVERIFY_USER_LOGIN_RES       = 0x0002,       // 返回用户登录结果
                };
                // CMDIN_SESSION
                enum {
                        SCMDIN_SESSION_USER_LOGOUT_NOTIFY       = 0x0001,       // 通知用户下线
                };


                // login cmd
                struct stLoginCmd : t_NullCmd
                {
                        stLoginCmd()
                                : t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN)
                        {
                                dest_type_ = UNREGISTEREDSERVER;
                                server_type_ = 0;
                                server_id_ = 0;
                        }

                        uint16_t dest_type_;
                        uint16_t server_type_;
                        uint16_t server_id_;
                };

                struct stLoginResponce : t_NullCmd
                {
                        stLoginResponce()
                                : t_NullCmd(CMDIN_LOGIN, SCMDIN_LOGIN_RESPONCE)
                        {
                        }
                };

                // loginverify cmd
                struct stUnregisteredUserLoginReq : t_NullCmd
                {
                        stUnregisteredUserLoginReq()
                                : t_NullCmd(CMDIN_LOGINVERIFY, SCMDIN_LOGINVERIFY_USER_LOGIN_REQ)
                        {
                                temp_id_ = 0;
                                task_id_ = 0;
                                user_id_ = 0;
                                latest_ver_ = 0;
                                ip_ = 0;
                        }

                        uint32_t temp_id_;
                        uint16_t task_id_;
                        uint32_t user_id_;
                        uint32_t latest_ver_;
                        uint32_t ip_;
                };

                struct stUnregisteredUserLoginRes : t_NullCmd
                {
                        stUnregisteredUserLoginRes()
                                : t_NullCmd(CMDIN_LOGINVERIFY, SCMDIN_LOGINVERIFY_USER_LOGIN_RES)
                        {
                                temp_id_ = 0;
                                task_id_ = 0;
                                user_id_ = 0;
                                latest_ver_ = 0;
                                ret_code_ = 0;
                        }

                        uint32_t temp_id_;
                        uint16_t task_id_;
                        uint32_t user_id_;
                        uint32_t latest_ver_;
                        uint8_t ret_code_;
                };

                // session cmd
                struct stUnregisteredUserLogoutNotify : t_NullCmd
                {
                        stUnregisteredUserLogoutNotify()
                                : t_NullCmd(CMDIN_SESSION, SCMDIN_SESSION_USER_LOGOUT_NOTIFY)
                        {
                                user_id_ = 0;
                        }

                        uint32_t user_id_;
                };
        };      // namespace Unregistered
};      // namespace Cmd

#pragma pack() //pack(1)

#endif  // _UnregisteredCommandIn_H_
